package top.yonyong.java8.G访问接口的默认方法;

import java.util.function.Function;

/**
 * @author yonyong
 **/
public class TestFunction {

    public static void main(String[] args) {
        Function<String,Integer> toInt = Integer::valueOf;
        final Integer apply = toInt.apply("123");
        System.out.println(apply);

        Function<String, Object> toString = toInt.andThen(String::valueOf);
        final Object apply1 = toString.apply("123456");
        System.out.println(apply1);

        final Function<String, Object> stringObjectFunction = toInt.andThen(i->i+1);
        final Object apply2 = stringObjectFunction.apply("991");
        System.out.println(apply2);
    }
}
